Skip to content

fix(workspaces-overview): show configured-host buckets even when empty#45

Merged
Zeus-Deus merged 2 commits into
mainfrom
investigate-missing-workspace
May 27, 2026
Merged

fix(workspaces-overview): show configured-host buckets even when empty#45
Zeus-Deus merged 2 commits into
mainfrom
investigate-missing-workspace

Conversation

@Zeus-Deus
Copy link
Copy Markdown
Owner

Summary

  • Empty configured-host buckets were getting stripped by the final filter pass, contradicting the comment on the bucket-build step that said "Pre-create the local + configured-host buckets so empty configured hosts still show up." A device the user had configured but never landed a workspace on stayed invisible — pushing any workspace to it was the only known workaround.
  • The fix carves out configured-host buckets (those carrying a local host-row id) from the empty-bucket filter. The local This device bucket and orphan buckets still follow the items/totalCount rule, so the overview won't render a dangling This device row on a brand-new account.
  • Adds a regression test that fails on the old filter and passes on the new one (verified by stashing the fix).

Why this bug existed

The bucket pipeline pre-creates a bucket for every configured host (lines 303–315) — the comment there explicitly states this is so empty configured hosts still show up. But the final .filter() six lines later required a non-zero items.length OR totalCount, silently undoing the intent. The push-workspace flow worked around it because pushing made totalCount non-zero.

Test plan

  • npm run test — 1767 tests pass (was 1766; +1 regression test)
  • cargo check --manifest-path src-tauri/Cargo.toml — clean
  • Regression test (shows a configured host's bucket even when no workspaces live on it yet) fails on the unfixed component, passes on the fixed one — verified by git stash-ing the fix and re-running
  • Visual sanity check in dev/prod: add a host, don't push any workspace, confirm its card appears in Workspaces

What's not in this PR

While investigating I noticed hosts_bootstrap_install is the only host-write command that doesn't trigger a hosts sync. That's a real but unrelated edge case (host added while signed out → row stays dirty + server_id null → device hidden for a different reason). Worth fixing in a follow-up, but not the cause of the reported issue, so it's out of scope here.

Zeus-Deus added 2 commits May 27, 2026 20:38
The npm version in package.json was bumped to 0.7.1 in f8976da but the
lock file was left at 0.7.0. Running 'npm install' brings the lock file
back in sync.
…hen empty

The overview pre-creates a bucket for every configured host so that a
device the user has set up shows in the overview the moment it's
added — the comment at the bucket-build step says exactly that. But
the final filter pass on the bucket list then stripped any bucket
whose `items.length` and `totalCount` were both zero, which silently
contradicted that intent. A device the user just added (or had
configured for ages but never landed a workspace on) was invisible
until the first workspace pushed to it bumped totalCount above zero.
That's why the only known workaround was "push any workspace to it" —
the push made the bucket non-empty.

The fix carves out configured-host buckets (those carrying a local
host row id) from the empty-bucket filter. The local 'This device'
bucket and orphan buckets (workspaces referencing an unknown
host_server_id) still follow the items/totalCount rule, so the
overview doesn't render a dangling 'This device' row for a brand-new
account with zero rows.

Adds a regression test that fails on the old filter and passes on the
new one.
@Zeus-Deus Zeus-Deus merged commit d14993e into main May 27, 2026
2 checks passed
@Zeus-Deus Zeus-Deus deleted the investigate-missing-workspace branch May 27, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant